﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace CoffeeChat.Client
{
    public class Input : Form
    {
        private System.ComponentModel.IContainer components = null;
        protected override void Dispose(bool disposing)
        {
            if ( disposing && ( components != null ) )
            {
                components.Dispose();
            }
            base.Dispose( disposing );
        }
        private void InitializeComponent()
        {
            this.textBoxInput = new System.Windows.Forms.TextBox();
            this.labelMessage = new System.Windows.Forms.Label();
            this.buttonOK = new System.Windows.Forms.Button();
            this.buttonCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // textBoxInput
            // 
            this.textBoxInput.Location = new System.Drawing.Point( 12, 31 );
            this.textBoxInput.Name = "textBoxInput";
            this.textBoxInput.Size = new System.Drawing.Size( 258, 20 );
            this.textBoxInput.TabIndex = 0;
            // 
            // labelMessage
            // 
            this.labelMessage.Dock = System.Windows.Forms.DockStyle.Top;
            this.labelMessage.Location = new System.Drawing.Point( 0, 0 );
            this.labelMessage.Name = "labelMessage";
            this.labelMessage.Size = new System.Drawing.Size( 282, 28 );
            this.labelMessage.TabIndex = 1;
            this.labelMessage.Text = "Type the stuff below.";
            this.labelMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // buttonOK
            // 
            this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.buttonOK.Location = new System.Drawing.Point( 195, 57 );
            this.buttonOK.Margin = new System.Windows.Forms.Padding( 3, 3, 3, 0 );
            this.buttonOK.Name = "buttonOK";
            this.buttonOK.Size = new System.Drawing.Size( 75, 23 );
            this.buttonOK.TabIndex = 4;
            this.buttonOK.Text = "OK";
            this.buttonOK.UseVisualStyleBackColor = true;
            // 
            // buttonCancel
            // 
            this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.buttonCancel.Location = new System.Drawing.Point( 114, 57 );
            this.buttonCancel.Margin = new System.Windows.Forms.Padding( 3, 3, 3, 0 );
            this.buttonCancel.Name = "buttonCancel";
            this.buttonCancel.Size = new System.Drawing.Size( 75, 23 );
            this.buttonCancel.TabIndex = 5;
            this.buttonCancel.Text = "Cancel";
            this.buttonCancel.UseVisualStyleBackColor = true;
            // 
            // Input
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F );
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size( 282, 89 );
            this.Controls.Add( this.textBoxInput );
            this.Controls.Add( this.labelMessage );
            this.Controls.Add( this.buttonOK );
            this.Controls.Add( this.buttonCancel );
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Name = "Input";
            this.Text = "Input";
            this.ResumeLayout( false );
            this.PerformLayout();

        }
        private TextBox textBoxInput;
        private Label labelMessage;
        private Button buttonOK;
        private Button buttonCancel;
        public Input()
        {
            this.InitializeComponent();
        }
        public static string GetText(string title, string message)
        {
            Input newInput = null;
            try
            {
                newInput = new Input();
                newInput.labelMessage.Text = message;
                newInput.Text = title;
                DialogResult result = newInput.ShowDialog();
                if ( result == DialogResult.OK )
                    return newInput.textBoxInput.Text;
                else
                    return null;
            }
            finally
            {
                if ( newInput != null )
                    newInput.Dispose();
            }
        }
    }
}
